<template>
    <div class="Message">
        <tabs :options="tabs" v-model="tabActive" @onclick="handleNavClick"/>
        <router-view/>
    </div>
</template>

<style lang="less">
    @import '../../../style/variable';
    .Message{
        .van-tab {
            flex-basis: 50%;
        }
    }
</style>

<script>
    export default {
        data(){
            return {
                tabs: ['系统消息', '留言管理'],
                tabActive: 0,
            }
        },
        created(){
            this.$store.commit('hideNav', true);
        },
        methods: {
            handleNavClick(key){
                const navRoutes = ['/user/message', '/user/message/admin'];
                this.$router.replace(navRoutes[key]);
            }
        }
    }
</script>